<?php
namespace app\api\logic;
use think\Db;
/**
* 所有类别
*/
class Indexs
{
	public function navList()
	{
		header("content-type:text/htm;charset=utf-8");
		$navList=Db::name('ApiNav')->where('navtype = 1')->order('navid asc')->select();
		foreach ($navList as $key => $value) {
			$where['navid']=$value['navid'];
			$where['navutype']=1;
			$navList[$key]['navulist']=Db::name('ApiNavu')->order('navuid asc')->where($where)->where('navutype = 1')->select();
			foreach ($navList[$key]['navulist'] as $k => $v) {
				$where['navid']=$navList[$key]['navulist'][$k]['navuid'];
				$navList[$key]['navulist'][$k]['navulists']=Db::name('ApiNavu')->where($where)->where('navutype = 1')->select();
				if($navList[$key]['navulist'][$k]['navuid']<10){
					$navList[$key]['navulist'][$k]['navulists']='';
				}else{
					foreach ($navList[$key]['navulist'][$k]['navulists'] as $ke => $va) {
						$where['navid']=$navList[$key]['navulist'][$k]['navulists'][$ke]['navuid'];
						$navList[$key]['navulist'][$k]['navulists'][$ke]['navulistss']=Db::name('ApiNavu')->where($where)->where('navutype = 1')->select();
						if(empty($navList[$key]['navulist'][$k]['navulists'][$ke]['navulistss'])){
							$navList[$key]['navulist'][$k]['navulists'][$ke]['navulistss']='';
						}
					}
				}
			}
		}
		if($navList){
			return $navList;
		}else{
			return false;
		}
	}
	/**
	*新闻
	*/
	public function newsList()
	{
		$newsList=Db::name('news')->where('newsstate = 1')->order('newstime desc')->select();
		if($newsList){
			return $newsList;
		}else{
			return false;
		}
	}
	/**
	* 首页新闻
	*/
	public function newsList_h()
	{
		$newsList=Db::name('news')->where('newsstate = 1 && newstype = 12')->order('newstime desc')->limit(4)->select();
		if($newsList){
			return $newsList;
		}else{
			return false;
		}
	}
	public function newsList_j()
	{
		$newsList=Db::name('news')->where('newsstate = 1 && newstype = 13')->order('newstime desc')->limit(4)->select();
		if($newsList){
			return $newsList;
		}else{
			return false;
		}
	}
	/**
	* 关于我们
	*/
	public function aboutus()
	{
		$aboutus=Db::name('aboutus')->where('aboutustype = 1')->find();
		if($aboutus){
			return $aboutus;
		}else{
			return false;
		}
	}
	/**
	*集团简介
	*/ 
	public function aboususj()
	{
		$aboususj=Db::name('aboutus')->where('aboutustype = 2')->find();
		if($aboususj){
			return $aboususj;
		}else{
			return false;
		}
	}
	/**
	*公司产业
	*/ 
	public function aboususc()
	{
		$aboususc=Db::name('aboutus')->where('aboutustype = 3')->find();
		if($aboususc){
			return $aboususc;
		}else{
			return false;
		}
	}
	/**
	* 合作伙伴
	*/ 
	public function cooperation()
	{
		$cooperation=Db::name('cooperation')->select();
		if($cooperation){
			return $cooperation;
		}else{
			return false;
		}
	}
}